import Vue from 'vue'
import VueRouter from 'vue-router'
import {warp_fun} from "../router_warp/router_warp_fun";

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/user/index'
  },
  {
    path: '/registration-agreement',
    name: 'RegistrationAgreement',
    component: warp_fun('RegistrationAgreement')
  },
  {
    path: '/privacy-clause',
    name: 'PrivacyClause',
    component: warp_fun('PrivacyClause')
  },
  {
    path: '/user/create_user',
    name: 'CreateUser',
    component: warp_fun('user/createUser')
  },
  {
    path: '/login',
    name: 'Login',
    component: warp_fun('login')
  },
  {
    path: '/grade',
    name: 'Grade',
    component: warp_fun('grade')
  },
  {
    path: '/gradeForm',
    name: 'GradeForm',
    component: warp_fun('gradeForm')
  },
  {
    path:'/user/register',
    name:'userRegister',
    component: warp_fun('user/userRegister')
  },
  {
    path:'/admin/index',
    name:'adminIndex',
    component: () => import(/* webpackChunkName: "adminIndex" */ '../views/admin/index.vue'),
    children:[
      {
        path:'/',
        redirect:'/admin/studentRegisterList'
      },
      {
        path:'/admin/studentRegisterList',
        name:'adminStudentRegisterList',
        component: () => import(/* webpackChunkName: "adminStudentRegisterList" */ '../views/admin/studentRegisterList/index.vue')
      },
      {
        path:'/admin/orgList',
        name:'adminOrgList',
        component: () => import(/* webpackChunkName: "adminOrgList" */ '../views/admin/orgList/index.vue')
      },
      {
        path:'/admin/examTime',
        name:'adminExamTime',
        component: () => import(/* webpackChunkName: "adminExamTime" */ '../views/admin/examTime/index.vue')
      },
      {
        path:'/admin/studentScore',
        name:'adminStudentScore',
        component: () => import(/* webpackChunkName: "adminStudentScore" */ '../views/admin/studentScore/index.vue')
      }
    ]
  },
    //机构
  {
    path:'/org/index',
    name:'orgIndex',
    component: () => import(/* webpackChunkName: "orgIndex" */ '../views/org/index.vue'),
    children:[
      {
        path:'/',
        redirect:'/org/studentRegisterList'
      },
      {
        path:'/org/studentRegisterList',
        name:'studentRegisterList',
        component: () => import(/* webpackChunkName: "studentList" */ '../views/org/studentRegisterList/index.vue')
      },
      {
        path:'/org/orgList',
        name:'orgList',
        component: () => import(/* webpackChunkName: "studentList" */ '../views/org/orgList/index.vue')
      },
      {
        path:'/org/examTime',
        name:'examTime',
        component: () => import(/* webpackChunkName: "studentList" */ '../views/org/examTime/index.vue')
      },
      {
        path:'/org/studentScore',
        name:'studentScore',
        component: () => import(/* webpackChunkName: "studentList" */ '../views/org/studentScore/index.vue')
      }
    ]
  },
    //用户
  {
    path:'/user/index',
    name:'userIndex',
    component: warp_fun('user'),
    children:[
      {
        path:'/',
        redirect:'/user/myExam'
      },
      {
        path:'/user/currentExam',
        name:'currentExam',
        component: () => import(/* webpackChunkName: "currentExam" */ '../views/user/currentExam/index.vue')
      },
      {
        path:'/user/examNotice',
        name:'examNotice',
        component: () => import(/* webpackChunkName: "examNotice" */ '../views/user/examNotice/index.vue')
      },
      {
        path:'/user/myExam',
        name:'myExam',
        component: () => import(/* webpackChunkName: "myExam" */ '../views/user/myExam/contentMain.vue')
      },
      {
        path:'/user/myMessage',
        name:'myMessage',
        component: () => import(/* webpackChunkName: "myMessage" */ '../views/user/myMessage/index.vue')
      },
      {
        path:'/user/examRecord',
        name:'examRecord',
        component: () => import(/* webpackChunkName: "myMessage" */ '../views/user/examRecord/index.vue')
      }
    ],
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
